package com.games.portal.rest;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.content.UriMatcher;
import android.net.Uri;

public class RestMethodFactory {

	private static RestMethodFactory instance = new RestMethodFactory();
	private static Object lock = new Object();
	private UriMatcher uriMatcher;
	private Context mContext;

	private static final int GAMES_LIST = 1;

	private RestMethodFactory() {
		uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
		uriMatcher.addURI(GameConstants.AUTHORITY, GameConstants.TABLE_NAME, GAMES_LIST);
	}

	public static RestMethodFactory getInstance() {

		return instance;
	}

	public RestMethod getRestMethod(Uri resourceUri, Method method,
			Map<String, List<String>> headers, byte[] body) {

		switch (uriMatcher.match(resourceUri)) {
		case GAMES_LIST:
			if (method == Method.GET) {
				return new GetGamesRestMethod();
			}
			break;

		}
		return null;
	}
	
}
